home *** CD-ROM | disk | FTP | other *** search
- const APP_DISPLAY_NAME = "All-in-One gestures";
- const APP_VERSION = "0.12.4";
- const APP_SHORT_NAME = "allinonegest";
- const APP_AUTHOR = "Marc_Boullet";
- const APP_PACKAGE = "/" + APP_AUTHOR + "/" + APP_SHORT_NAME;
- const APP_JAR_FILE = APP_SHORT_NAME + ".jar";
- const APP_CONTENT_FOLDER = "content/" + APP_SHORT_NAME + "/";
- const APP_LOCALE_FOLDER = "locale/en-US/" + APP_SHORT_NAME + "/";
- const BLD_XUL_TREE_REWRITE = 20000417;
- const BLD_XPI_RESTART_MESSAGE = 20031211;
- const APP_WHERE_MESSAGE = "Install " + APP_DISPLAY_NAME + " to your profile folder (OK) or to your program folder (Cancel) ?";
- const APP_BUILD_TOO_OLD = APP_DISPLAY_NAME + " " + APP_VERSION + " must be installed to builds released after " + BLD_XUL_TREE_REWRITE + " !";
-
- var currBuild = new String(buildID).substr(0, 8) - 0;
- if (currBuild && currBuild < BLD_XUL_TREE_REWRITE) {
- alert(APP_BUILD_TOO_OLD);
- cancelInstall();
- }
- else {
- initInstall(APP_DISPLAY_NAME, APP_SHORT_NAME, APP_VERSION);
- var where, chromef;
- var inProfile = confirm(APP_WHERE_MESSAGE);
- if (inProfile) {
- chromef = getFolder("Profile", "chrome");
- where = PROFILE_CHROME;
- }
- else {
- chromef = getFolder("chrome");
- where = DELAYED_CHROME;
- }
- var err = addFile(APP_PACKAGE, APP_VERSION, "chrome/" + APP_JAR_FILE, chromef, null);
- if (err == SUCCESS) {
- var jar = getFolder(chromef, APP_JAR_FILE);
- registerChrome(CONTENT | where, jar, APP_CONTENT_FOLDER);
- registerChrome(LOCALE | where, jar, APP_LOCALE_FOLDER);
- performInstall();
- err = getLastError();
- if (err == SUCCESS) {
- // if (currBuild && currBuild < BLD_XPI_RESTART_MESSAGE)
- alert(APP_DISPLAY_NAME + " version " + APP_VERSION + " has been successfully installed to your " +
- (inProfile?"profile":"program") + " folder.\n\n" +
- "Please, restart Firefox before continuing!");
- }
- else {
- if (err == REBOOT_NEEDED) alert("Install failed because a previous version of " + APP_DISPLAY_NAME + " has not been uninstalled.");
- else alert("Install failed! Error code:" + err);
- cancelInstall(err);
- }
- }
- else {
- alert("Failed to create " + APP_JAR_FILE +"\n" +
- "You probably don't have appropriate permissions \n" +
- "(write access to " + (inProfile?"profile":"Firefox") + "/chrome directory). \n" +
- "_____________________________\nError code:" + err);
- cancelInstall(err);
- }
- }
-